<!-- PDF阅读器 -->
<template>
  <iframe :src="fullPDFSrc" frameborder="0"   ref="iframe" width="100%" hei id="pdfvieweriframe"></iframe>
</template>

<script>
export default {
  name: 'PdfViewer',
  props: {
    src: {
      type: String,
      default: ''
    }
  },
  components: {},
  data: function () {
    return {
      // dialogVisible: true
    }
  },
  computed: {
    fullPDFSrc: function () {
      return '/static/pdfjs/web/viewer.html?file=' + this.src
    }
  },
  mounted: function() {
    const oIframe = document.getElementById('pdfvieweriframe')
    // const deviceWidth = document.documentElement.clientWidth
    const deviceHeight = document.documentElement.clientHeight
    // oIframe.style.width = (Number(deviceWidth) - 0) + 'px' // 数字是页面布局宽度差值
    oIframe.style.height = (Number(deviceHeight) - 150) + 'px' // 数字是页面布局高度差
  }
}
</script>
<style>
</style>
